package com.vision.bigDataApi.controller.oracle;



import com.vision.bigDataApi.enums.ReturnStatus;
import com.vision.bigDataApi.service.common.SqlTestService;
import com.vision.bigDataApi.service.common.ResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

@Controller
@RequestMapping("/sqlTest")
public class SqlTestController {

    @Autowired
    private SqlTestService sqlTestService;

    @Autowired
    private ResultService resultservice;


    @RequestMapping(value = "t")
    public ModelAndView t(String name){
        ModelAndView mv=new ModelAndView();
        mv.setViewName("index");
        mv.addObject("name",name);
       return mv;
    }

    @RequestMapping(value = "test")
    public String sqlTest(){
        Map<String, Object> map = sqlTestService.sqlTest();
        return resultservice.result(ReturnStatus.SUCCESS,map,"成功",null);
    }

}
